<?php

class ist extends CI_Controller
{

    /**
     * 七牛云对接
     */
    public function qiniu(){

        $_name = $_POST['name'];
        $_path = $_POST['path'];

        $this->load->library('Qiniu');

        $url = $this->config->item('qiniu')['url'];
        //报价确认单的地址
        if ($_FILES[$_name]['error'] == 0) {
            $mime1 = substr($_FILES[$_name]['name'],strrpos($_FILES[$_name]['name'],'.')); //取得上传图片的后缀名

            $fileName = $_path.date('YmdHis').rand(1000,2000).$mime1;

            $this->qiniu->upload($_FILES[$_name]['tmp_name'],$fileName);
//        报价确认单的地址
            $file = $url.$fileName;
        } else {
            $file = '';
        }

        return $file;
    }

}










































